{% extends "base.html" %}
{% block title %}
    详情
{% endblock %}

{% block head %}
    <link rel="stylesheet" href="{{ url_for('static',filename='css/detail.css') }}">
{% endblock %}
{% block main %}
    <div class="detail-main">
        <h3 class="page-title">详情</h3>
        <div class="form-group">
            <input type="text" class="form-control" value="{{ question.title }}" readonly="readonly"/>
        </div>
        <div class="form-group">
            <textarea class="form-control" readonly="readonly" rows="5">{{ question.content }}</textarea>
        </div>
        <br/>
        <h2>0个答案</h2>
        <hr/>
        <div class="answer-main">
            <ul>

                {% for answer in question.answers %}
                    <li class="answer-li">
                        <div class="ava-img">
                            <img src="{{ url_for('static',filename='image/avatar.jpg') }}">
                        </div>
                        <div class="answer">
                            <div class="answer-content">{{ answer.content }}</div>
                            <div class="answerer-info">
                                <span>{{ answer.author.username }}</span>
                                <span>{{ answer.create_time }}</span>
                            </div>
                        </div>

                    </li>
                {% endfor %}
            </ul>
        </div>

        <hr/>
        <div class="submit-answer">

            <div class="form-group">
                <form action="{{ url_for('answer') }}" method="post">
                    <div class="form-group">
                        <input type="hidden" name="question_id" value="{{ question.id }}">
                        <input type="text" name="answer_content" class="form-control">
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-default btn-primary">提交</button>

                    </div>
                </form>
            </div>

        </div>
    </div>
{% endblock %}
